Skip to content

Merge SA 2.1 compat into core20.py, supporting both SA 2.0 and 2.1#254

Merged
kneth merged 2 commits intokneth/sqlalchemy-21-compatibilityfrom
kneth/sqlalchemy-21-compatibility-consolidated
Apr 13, 2026
Merged

Merge SA 2.1 compat into core20.py, supporting both SA 2.0 and 2.1#254
kneth merged 2 commits intokneth/sqlalchemy-21-compatibilityfrom
kneth/sqlalchemy-21-compatibility-consolidated

Conversation

@kneth
Copy link
Copy Markdown
Member

@kneth kneth commented Mar 20, 2026

Summary of the changes / Why this is an improvement

A commit in response to #253 (comment)

Checklist

  • Link to issue this PR refers to (if applicable): Fixes #???

Consolidate `core21.py` into `core20.py` by guarding the three
SA 2.1-specific differences behind `SA_VERSION >= SA_2_1` checks:
- `visiting_cte` parameter and `toplevel` logic in `visit_update`
- `update_post_criteria_clause` (renamed from `update_limit_clause`)
- removal of the `_ordered_values` branch in `_get_crud_params`

Delete `core21.py` and simplify the dialect dispatch to always use
`CrateCompilerSA20` for SA >= 2.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 47e888f2-d150-4654-be68-665d4e80a2c8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kneth/sqlalchemy-21-compatibility-consolidated

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kneth kneth mentioned this pull request Mar 20, 2026
1 task
@amotl amotl requested review from amotl, matriv and seut March 30, 2026 20:52
Copy link
Copy Markdown
Member

@amotl amotl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Kenneth. @mfussenegger agreed on this at #253 (comment). Can you integrate it into the other PR if you are also convinced this is the right solution?

Please let us know about any concerns. If @matriv has a minute, he might also have a look. Otherwise, please proceed. 🙏

@kneth kneth marked this pull request as ready for review April 13, 2026 07:39
@kneth kneth merged commit 920c1ff into kneth/sqlalchemy-21-compatibility Apr 13, 2026
34 checks passed
@kneth kneth deleted the kneth/sqlalchemy-21-compatibility-consolidated branch April 13, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants